package acm.蓝桥5;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Scanner;

public class 水题2 {
    static String[] m={"01","02","03","04","05","06","07","08","09","10","11","12"};
    static String[] d={"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"};
    static String y;
    static SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
    }

    public static boolean checkDate(String s){
        try {
            sdf.parse(s);
        } catch (ParseException e) {
            return false;
        }
        return true;
    }
    public static String nextDate(String s){
        String substring = s.substring(4, 8);
        String substring1 = s.substring(0, 4);
        if (substring.equals("1231")){
            return (Integer.parseInt(substring1)+1)+"0101";
        }
        for (int i = 0; i < d.length; i++) {
            if (substring.equals(d[i])){
                return substring1+m[i]+d[0];
            }
        }
        return null;
    }
}
